//模块主窗口
HighFeeUserPanel = Ext.extend(Ext.Panel,{
	 closable: true,
   	 autoScroll:true,
   	 width:'100%',
   	 initComponent : function() {
   			this.tbar =  this.buildBbar() ;
   			var condObj = null;
   			if(this.condObj) {
   				condObj = this.condObj;
   			}
   			var gd = new highFeeUserListPanel({'monitorTypes':this.monitorType,'condObj':condObj}) ;
   			this.items = [new QueryHighForm({
					thisGrid:gd
				}),gd] ;
				
			this.updatePanel =  null ;
   			
   		HighFeeUserPanel.superclass.initComponent.call(this);
   	},
   	showUpdatePanel : function(btn) {
   		 var mPanel = btn.ownerCt.ownerCt;
   		 var gp = mPanel.items.get(1) ;
   		 var rows= gp.getSelectionModel().getSelections(); 
   		 if(rows.length==0) {
 			MsgTip.msg({
			 	msg:"请选择一条记录"
			 	,cmp: mPanel
			 	,pos:"top"
			 	,time:2
			});
   			 return ;
   		 }
   		 if(!mPanel.updatePanel) {
   			mPanel.updatePanel = new Ext.Window({
	   			layout:"fit",
	   			title: "处理问题",
	   			closeAction: 'hide',
				resizable:false,
				modal:true,
				width:400,
				height:200,
				items :[{
					xtype:'form'
					,layout:'form'
					,border:false
					,labelAlign:"left"
					,frame:true
					,items:[{
						fieldLabel:'处理描述'
						,xtype:'textarea'
						,labelWidth:65
						,name:'myFee.dealText'
						,height:100
						,anchor:'95%'
					}]
					,minButtonWidth:50
			   		,buttonAlign:'center'
				   	,buttons:[{
				   		text:'提交'
				   		,handler:function(btn) {
				   			var form = btn.ownerCt.ownerCt.getForm();
				   				mPanel.execInfo(mPanel,form);
				   			} 
				   		}]
				}]
				
   			});
   		}
   	    mPanel.updatePanel.show();
   	},
   	execInfo: function(m,form) {
   		var gp = m.items.get(1) ;
   		var rows= gp.getSelectionModel().getSelections(); 
   		var ids = "";
   		for(var i=0 ;i<rows.length;i++) {
   			if(i==0) {
   				ids = rows[i].data['hfuid'] ;
   			}else{
   				ids = ids +","+rows[i].data['hfuid'] ;
   			}
   		}
   		form.submit( {
				waitTitle : '请稍候...',
				waitMsg : '正在提交表单数据,请稍候...',
				method : 'post',
				params : {
					ids:ids 
				},
				url : 'highFee_updateFlag.action?myFee.monitorType='+m.monitorType,
				scope : this,
				success : function(form, action) {
					var Result=action.result;
					if(Result.success) {
						gp.getStore().reload();
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"处理成功~~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					} else {
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"处理异常,请重试~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					}
				},
				failure : function() {
						m.updatePanel.hide() ;
						MsgTip.msg({
						 	msg:"网络异常,请重试~"
						 	,cmp: m
						 	,pos:"top"
						 	,time:2
						});
					}
				});
   	},
   	buildBbar: function() {
   		return [
   			{
   				text : "显示查询",
   				iconCls: 'ico-dot-search-open',
   				handler:function(btn){
   					var m = btn.ownerCt.ownerCt;
   					var g = m.items.get(1);
   					var a = m.items.get(0);
   					a.setHeight(100);
   					a.searchBtn = btn;
   					if(a.collapsed) {
   						var h1 = m.getHeight()-m.tbar.dom.clientHeight-a.getHeight();
   						a.expand(true);
   						g.setHeight(h1-100);
   						btn.setText("隐藏查询");
   						btn.setIconClass("ico-dot-search-hidden");
   					} else {
   						a.collapse(true);
   						g.setHeight(m.getHeight()-m.tbar.dom.clientHeight-1);
   						btn.setText("显示查询");
   						btn.setIconClass("ico-dot-search-open");
   					}
   				}
   			},'-',{
   				text : "问题处理",
   				handler :this.showUpdatePanel,
   				iconCls: 'ico-dot-edit-news'
   			},'-',{
   				text : "数据导出",
   				handler :this.exportData,
   				iconCls: 'ico-dot-report'
   			/*},'-',{
   				text : "告警级别说明",
   				handler:this.readInfo,
   				iconCls: 'ico-dot-question'
   			*/
   			},'->',{
                      text:'使用说明'          
                      ,iconCls:'ico-dot-book-question'
                      ,handler:function(btn){
                      var m = btn.ownerCt.ownerCt.monitorType;
                      if(m==1){
                        SM.Explanation.showExplanation(15);
                      }
                      if(m==2){
                        SM.Explanation.showExplanation(11);
                      }
                      if(m==3){
                        SM.Explanation.showExplanation(13);
                      }
                      if(m==4){
                        SM.Explanation.showExplanation(23);
                      }
                      if(m==5){
                        SM.Explanation.showExplanation(25);
                      }
                    }
                   }
   			] ;
   	},
   	readInfo : function(){
   		new Ext.Window({
   			layout:"border",
   			title: "告警级别说明信息",
   			closeAction: 'close',
			resizable:false,
			modal:true,
			width:400,
			height:350,
			items :[new ReadInfoForm({})]
   		}).show();
   	},
   	exportData:function(btn) {
   		var gp = btn.ownerCt.ownerCt.items.get(1) ;
   		var baseParams = gp.getStore().baseParams;
   		var ul = Ext.urlEncode(baseParams);
   		var monitorType = btn.ownerCt.ownerCt.monitorType;
   		var st = gp.getStore();
   		Ext.MessageBox.confirm("确认", "确定导出?", function(btn) {
		if (btn == "yes") {
			window.location.href ="highFee_exportUserFeeDateToExcel.action?myFee.monitorType="+monitorType+"&limit="+st.totalLength+"&"+ul;
		}
		});
   		
   	}
});

//告警级别说明帮助信息
ReadInfoForm = Ext.extend(Ext.form.FormPanel,{
	text:"表单",
	layout:"form",
	region : "center",
	labelAlign:"left",
	width:400,
	height:350,
	frame:true,
	initComponent: function(){
	this.items=[{fieldLabel : '&nbsp;&nbsp;预警告警&nbsp;&nbsp;<img src="images/073.png"/>&nbsp;&nbsp;',
	                value : '阀值为 100 元                                               不影响现有业务，但发展下去有可能影响业务，可视需要采取措施的告警。',
					xtype : 'textarea',
					anchor:"97%"
				},{fieldLabel : '&nbsp;&nbsp;警告告警&nbsp;&nbsp;<img src="images/076.png"/>&nbsp;&nbsp;',
					value : '阀值为 500 元                                               不影响现有业务，但需进行检查核对以阻止恶化的告警。',
					xtype : 'textarea',
					anchor:"97%"
				},{fieldLabel : '&nbsp;&nbsp;严重告警&nbsp;&nbsp;<img src="images/071.png"/>&nbsp;&nbsp;',
					value : '阀值为 1000 元                                             影响业务并需要立即进行故障检查核对的告警。',
					xtype:"textarea",
				    anchor:"97%" 
				},{fieldLabel : '&nbsp;&nbsp;紧急告警&nbsp;&nbsp;<img src="images/075.png"/>&nbsp;&nbsp;',
					value : '使业务中断或异常情况并需要立即进行故障检查核对的告警',
					xtype : 'textarea',
					anchor:"97%"
				}
		];
	  ReadInfoForm.superclass.initComponent.call(this);
	},
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
		text : '关闭',
		handler : function() {this.ownerCt.ownerCt.ownerCt.hide();}
	}]
});

/*按条件查询高额用户
QueryHighFeeUserForm = Ext.extend(Ext.form.FormPanel,{
	text:"表单",
	layout:"form",
	region : "center",
	labelAlign:"right",
	width:550,
	height:300,
	frame:true,
	initComponent: function(){
	var cityNameSelect = new Ext.data.JsonStore({
	    url: "highFee_getCityCode.action?type=1",//第一个comboBox的json数据的URL地址
	    root: "root",
	    fields: ["paramValue", "displayValue"]
	});
	this.items=[{fieldLabel : '归属地市',
							name : 'eparchyCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : areaCodeSelect,
							emptyText:"请选择",
							anchor:"90%",
							listeners : {
		 						"select": function(combo){
									combo.ownerCt.getForm().findField("cityCode").reset();
									cityNameSelect.baseParams={'areaCode':combo.getValue()};
									cityNameSelect.load();
		 						}
							}
						},{fieldLabel : '归属区县',
							name : 'cityCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : cityNameSelect,
							emptyText:"请选择",
							anchor:"90%"
						},{fieldLabel : '账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期',
							name : 'cycleId',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							triggerAction : 'all',
							store : getCyids(),//  [['0','请选择'],['201303','201303'],['201304','201304'],['201305','201305']],
							anchor:"90%",
							emptyText:"请选择"
					    },{fieldLabel : '稽核日期',
							name : 'statDay',
							xtype:"datefield",
							editable : false,
							format:'Y-m-d',
							emptyText:"请选择",
							anchor:"90%"
					    },{fieldLabel : '客户类型',
							name : 'netTypeCode',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							emptyText:"请选择",
							triggerAction : 'all',
							store : [['0','全部'],['10','2G用户'],['33','3G用户']],
							anchor:"90%"
						 },{fieldLabel : '业务类型',
							name : 'bizType',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							emptyText:"请选择",
							triggerAction : 'all',
							store : [['0','全部'],['1','语音'],['2','短信'],['3','GPRS']],
							anchor:"90%"
						},{fieldLabel : '告警级别',
							name : 'curstatus',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							triggerAction : 'all',
							emptyText:"请选择",
							store : [['0','全部'],['1','预警'],['2','警告'],['3','严重'],['4','紧急']],
							anchor:"90%"
						},{fieldLabel : '用户编码',
							name : 'userId',
							xtype : 'textfield',
							maxLength:20,//能够输入的内容的最大长度
                            maxLengthText:"输入内容太长了",//超出最大长度的设置信息
							anchor:"90%"
						},{fieldLabel : '用户名称',
							name : 'userName',
							xtype : 'textfield',
							anchor:"90%"
						},{fieldLabel : '用户号码',
							name : 'msisdn',
							xtype : 'textfield',
							anchor:"90%"
						}
		];
	  QueryHighFeeUserForm.superclass.initComponent.call(this);
	},
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
		text:"确定",
		handler : function(btn){
		    var thisForm = btn.ownerCt.ownerCt.getForm();
		    var eparchyCode  = thisForm.findField('eparchyCode').getValue();
		    var statDay = thisForm.findField('statDay').getValue();	 
		    	statDay = statDay?statDay.format("Ymd"):"";	    
		    var netTypeCode = thisForm.findField('netTypeCode').getValue();
		    var bizType = thisForm.findField('bizType').getValue();
		    var curstatus = thisForm.findField('curstatus').getValue();
		    var userId = thisForm.findField('userId').getValue();
		    var msisdn = thisForm.findField('msisdn').getValue();
		    var userName = thisForm.findField('userName').getValue();
			var cityCode = thisForm.findField('cityCode').getValue();
			var cycleId = thisForm.findField('cycleId').getValue();
			var curstatus = thisForm.findField('curstatus').getValue();
		    var store = btn.ownerCt.ownerCt.thisGrid.getStore();
		    btn.ownerCt.ownerCt.thisGrid.recordStart = 1;
		    var taskSeq = store.baseParams?store.baseParams['myFee.taskSeq']||'':'';
		    store.baseParams = {
				'myFee.userId':userId,
				'myFee.userNbr':msisdn,
				'myFee.eparchyCode':eparchyCode,
				'myFee.cityCode':cityCode,
				'myFee.bizType':bizType,
				'myFee.cycleid':cycleId,
				'myFee.statDay':statDay,
				'myFee.userName':userName,
				'myFee.curstatus':curstatus,
				'myFee.netTypeCode':netTypeCode
		    			//'highFeeUser.areaName':cityCode
			};

            store.load({params:{start:0, limit:200}});
		    
		   this.ownerCt.ownerCt.ownerCt.hide();//隐藏弹出页面
		}
	}, {
		text : '重置',
		handler : function() {this.ownerCt.ownerCt.form.reset();}
	}, {
		text : '取消',
		handler : function() {this.ownerCt.ownerCt.ownerCt.hide();}
	}]
});
*/
//高额用户信息列表
highFeeUserListPanel = Ext.extend(Ext.grid.GridPanel,{
	title : '高额用户信息列表',
	header: false,
	loadMask:{msg:'加载中...'},
	columnLines:true,
	enableDragDrop: false,
	headerAlign:"center",
	height: 600,
	viewConfig :{
        //forceFit: true
    },
	initComponent : function() {
       	var thisGrid = this;
       	this.recordStart = 1 ;
    	var highFeeUserCm = new Ext.grid.CheckboxSelectionModel({
				dataIndex: "uid",
                sortable: false,
                singleSelect:false,
                width:20
		});
		var highFeeUserNew = new　Ext.grid.RowNumberer({
		　　header　:　"序号",
		　　width　:　35
		　　
		});
		this.columns　=　[
		highFeeUserCm,
		highFeeUserNew,{
	        header:'账期',
			sortable:true,
			hidden:true,
			headerAlign:"center",
			dataIndex:"cycleid",
			width:60
		},　
		     {
			header:'归属地市',
			sortable:true,
			headerAlign:"center",
			dataIndex:"eparchyName",
			width:62
		},{
			sortable:true,
			hidden:true,
			headerAlign:"center",
			dataIndex:"eparchyCode",
			width:62
		},　
		     {
			header:'归属区县',
			sortable:true,
			headerAlign:"center",
			dataIndex:"cityName",
			width:62
		},{ 
		    header:'网别',
			sortable:true,
			dataIndex:"netTypeCode",
			width:100,
			headerAlign:"center",
			renderer:changerNetTypeCode
		},{
			header:'用户号码',
			sortable:true,
			headerAlign:"center",
			dataIndex:"userNbr",
			width:100
		},{
			header:'业务类型',
			sortable:true,
			dataIndex:"bizType",
			headerAlign:"center",
			width:70,
			renderer:changerBizTypeNew
		},{
			header:'用户编码',
			sortable:true,
			hidden:true,
			headerAlign:"center",
			dataIndex:"userId",
			width:120,
				listeners:{
	       			 dblclick:function(n,x){
		       			var rec =x.getSelectionModel().getSelected(),a,bizType;
		       			bizType = rec.data['bizType'] ;
		       			if(bizType=="1") {
		       				if(x.showUserPhoneBillVoice==null) {
		       					x.showUserPhoneBillVoice = new ShowUserPhoneBill({bizType:'1'}) ;;
		       				}
		       				a = x.showUserPhoneBillVoice;
		       			}else if(bizType=="2") {
		       				if(x.showUserPhoneBillSms==null) {
		       					x.showUserPhoneBillSms = new ShowUserPhoneBill({bizType:'2'}) ;
		       				}
		       				a = x.showUserPhoneBillSms;
		       			}else if(bizType=="3") {
		       				if(x.showUserPhoneBillGs==null) {
		       					x.showUserPhoneBillGs =new ShowUserPhoneBill({bizType:'3'}) ;
		       				}
		       				a = x.showUserPhoneBillGs;
		       			}
		       			a.store.removeAll();
		       			a.show();
		       			a.store.baseParams = {
		       									userId:rec.data['userId'],
		       									bizType:bizType,
		       									month:rec.data['cycleid'],
		       									monitorType:x.monitorTypes
		       								};
		       			a.store.reload();
	       			}
	   			 }
		},{
			header:'用户套餐',
			sortable:true,
			//hidden:true,
			headerAlign:"center",
			dataIndex:"discntName",
			width:100,
	   		renderer: function(value, metaData, record, rowIndex, colIndex, store) {
	   			metaData.attr = ' ext:qtip="' + value + '"';
	   			return "<img src='images/infocard.png'/>"+value ;
	   		},
			listeners:{
	       			 dblclick:function(n,x){
		       			var rec =x.getSelectionModel().getSelected();
		       			if(x.showUserOrder==null) {
		       				x.showUserOrder = new ShowUserOreder()
		       			}
		       			var a = x.showUserOrder;
		       			a.store.removeAll();
		       			a.show();
		       			a.store.baseParams = {userId:rec.data['userId'],areaCode:rec.data['eparchyCode']};
		       			a.store.reload();
	       			}
	   			 }
		},{
		    header:'当时费用(元)',
			sortable:true,
			align :"right",
			headerAlign:"center",
			dataIndex:"curfee",
			width:100,
			renderer:function(v) {
				return Ext.util.Format.chMoney(parseFloat(v/100).toFixed(2));
			}
		},{
			header:'实时费用(元)',
			sortable:true,
			dataIndex:"realFee",
			headerAlign:"center",
			width:100,
			align :"right",
			renderer:Ext.util.Format.chMoney
		},{
			header:'实时结余(元)',
			sortable:true,
			headerAlign:"center",
			dataIndex:"leaveRealFee",
			width:100,
			align :"right",
			renderer:Ext.util.Format.chMoney
		},{
			header:'信用度(元)',
			sortable:true,
			align :"right",
			headerAlign:"center",
			dataIndex:"credibility",
			width:100,
			renderer:function(v) {
				return Ext.util.Format.chMoney(parseFloat(v/100).toFixed(2));
			}
		},{
				header:'用户状态',
				sortable:true,
				headerAlign:"center",
				dataIndex:"serviceStateCode",
				align :"center",
				renderer:changerSerStateCode
			}
		,{
				header:'告警级别',
				sortable:true,
				headerAlign:"center",
				dataIndex:"curstatus",
				renderer:changerStatus
			}
			,{
				header:'是否处理',
				sortable:true,
				headerAlign:"center",
				dataIndex:"dealFlag",
				renderer:function(v) {
					return v==1?"已处理":"未处理";
				}
			},{
				header:'处理描述',
				sortable:true,
				headerAlign:"center",
				dataIndex:"dealText",
				renderer:function(value, metaData, record, rowIndex, colIndex, store) {
	   			metaData.attr = ' ext:qtip="' + value + '"';
	   			return value ;
	   		}
			}
		,{
				hidden :true,
				dataIndex:"uid"
			}
		] ;
		var dataStore = new Ext.data.JsonStore({
			url : 'highFee_getHighFeeUserList.action?myFee.monitorType='+this.monitorTypes,
			root: 'root',
			id:'hfuid',
	        totalProperty: 'totalProperty',
	        fields: [
				'taskSeq','statDay','eparchyName','cityName','leaveRealFee','realFee','hfuid','cycleid','monitorType','dbNo','eparchyCode','cityCode','ratePath','bizType','userId','userNbr','netTypeCode','prepayTag','serviceStateCode','charge','credibility','custType','userName','discntName','curfee','curstatus','inTime','dealTime','dealFlag','dealText','sendFlag','stopRuleId','listControlId','payModeCode','payMode','nodealSet','nodealInfo'
	        	]
		});
	
		this.showUserOrder = null;
		this.showUserPhoneBillGs = null;//new ShowUserPhoneBill({bizType:'3'}) ;
		this.showUserPhoneBillVoice = null;//new ShowUserPhoneBill({bizType:'1'}) ;
		this.showUserPhoneBillSms = null;//new ShowUserPhoneBill({bizType:'2'}) ;
	    dataStore.baseParams ={'myFee':null};
		this.store = dataStore;
		this.sm = highFeeUserCm;
		this.mk=new Ext.LoadMask(Ext.getBody(),{
							msg:'正在努力为您加载数据，请稍候...'
				});
		this.bbar = new Ext.PagingToolbar({
			pageSize : 200,
			store : dataStore,
			displayInfo : true,
			displayMsg : '第 {0} - {1} 条  共 {2} 条',
			emptyMsg : "没有记录",
			listeners:{
				beforechange:function(pt,obj) {
					thisGrid.recordStart = obj.start+1 ;
				    
				}
			}
		});
		if(this.condObj) {
			var p = {};
			for(var o in this.condObj) {
				p['myFee.'+o]=this.condObj[o];
			}
			dataStore.baseParams = p;
		}

	highFeeUserListPanel.superclass.initComponent.call(this);
	},listeners : {
   		'afterrender':function(com) {
   			com.getStore().load({
					params:{
					start:0,
					limit:100
					}
			});
   		}
   	}
});

ShowUserOreder = Ext.extend(Ext.Window,{
				layout:'form',
                width:650,
                height:295,
                title:"用户的订购信息",
                modal:false,
                closeAction:'hide',
                resizable : true,
                plain: true,
                store:new Ext.data.JsonStore({
					        root: 'root',
					        totalProperty: 'totalProperty',
					        idProperty: 'discntId',
					        fields: [
					            'discntId', 'name', 'startTime','endTime'
					        ]
					        ,url: 'highFee_getUserOrder.action'
				        }),
                initComponent: function(){
				
                this.items= [  new Ext.grid.GridPanel({
                	 anchor:'100%',
                	 height:300,
                	 loadMask:{msg:'加载中...'},
                     viewConfig: {
                       forceFit: true
                      },
                      columns:[{header:'资费标识',dataIndex: 'discntId'},
                      	       {header:'资费名称',dataIndex: 'name'},
                      	       {header:'生效时间',dataIndex:'startTime'},
                      	       {header:'失效时间',dataIndex:'endTime'}],
                      store:this.store
                	})],
                this.buttons= [{
                 text:'关闭',
                 listeners:{
                 	click:function(n) {
                 		this.ownerCt.ownerCt.hide();
                 	}
                 }
                }];
                ShowUserOreder.superclass.initComponent.call(this);
      }
});


ShowUserConsum = Ext.extend(Ext.Window,{
				layout:'fit',
                width:600,
                height:550,
                title:"用户当前账期消费情况",
                modal:false,
                closeAction:'close',
                resizable : true,
                plain: true,
                initComponent: function(){
                this.buttons= [{
                 text:'关闭',
                 listeners:{
                 	click:function(n) {
                 		this.ownerCt.ownerCt.hide();
                 	}
                 }
                }];
                
                var fusionPanel = new Ext.ux.Chart.Fusion.Panel({
					collapsible:false,
					chartCfg:{
						params:{
							flashVars:{
								debugMode:0,
								lang:'EN'
							}
						}
					},
					id:'chartpanel',
					chartURL:'ext-3.4.0/charts/Pie3D.swf' , 
					width:590,
					height:498	
				});
                this.fusionPanel = fusionPanel ;
                this.items = [fusionPanel] ;
                ShowUserConsum.superclass.initComponent.call(this);
               
      }
});


ShowUserPhoneBill  = Ext.extend(Ext.Window,{
				layout:'form',
                width:850,
                height:546,
                title:"用户的详单信息",
                modal:false,
                closeAction:'hide',
                resizable : true,
                plain: true,
                store:new Ext.data.JsonStore({
					        root: 'root',
					        totalProperty: 'totalProperty',
					        idProperty: 'id',
					        fields: [
					            'id','msisdn', 'otherParty', 'discountBfee','startTime','endTime','nationName','startDate','endDate','callType','roamType','asp','cfeeOrg','cfee','disCfee','dfeeOrg','dfee','disDfee'
					        ],
					        url: 'highFee_getUserPhoneBill.action'
				        }),
                initComponent: function(){
				var fixed = this.ToFixed ;
				if(this.bizType==1) {
					var columns = [{header:'呼叫类型',width:70,dataIndex: 'callType'},
                    	 		  {header:'漫游类型',width:80,dataIndex: 'roamType'},
                    	 		  {header:'到访地',width:60,dataIndex: 'nationName'},
                      	          {header:'对端号码',width:140,dataIndex: 'otherParty'},
                      	          {header:'对端运营商',width:100,dataIndex:'asp'},
                      	          {header:"费用(元)",dataIndex: 'discountBfee',align :"right",
									renderer:fixed},
                      	          {header:'开始时间',width:140,dataIndex:'startTime',align :"right"},
                      	          {header:'结束时间',width:140,dataIndex:'endTime'}] ;
					
				} else if(this.bizType==3) {
					var columns = [{header:'用户号码',dataIndex: 'msisdn'},
                      	          {header:'到访地',width:100,dataIndex: 'nationName'},
                      	          {header:"原始费用(元)",dataIndex: 'cfee',align :"center",renderer:fixed},
                      	          {header:"优惠后费用(元)",dataIndex: 'disCfee',align :"center",renderer:fixed},
                      	          {header:'开始时间',dataIndex:'startTime'}]
					
				}else if(this.bizType==2) {
					 var columns = [{header:'用户号码',width:100,dataIndex: 'msisdn'},
								  {header:'呼叫类型',width:70,dataIndex: 'callType'},
                    	 		  {header:'漫游类型',width:80,dataIndex: 'roamType'},
                      	          {header:'对端号码',width:100,dataIndex: 'otherParty'},
                      	          {header:'对端运营商',width:100,dataIndex:'asp'},
                      	          {header:"费用(元)",dataIndex: 'discountBfee',align :"right",
									renderer:fixed},
                      	          {header:'开始时间',width:140,dataIndex:'startTime',align :"right"},
                      	          {header:'结束时间',width:140,dataIndex:'endTime'}] ;
				}
	
                this.items= [  new Ext.grid.GridPanel({
                	 anchor:'100%',
                	 height:500,
                	 loadMask:{msg:'加载中...'},
                     viewConfig: {
                       forceFit: true
                      },
                      columns:columns,
                      store:this.store
                	})],
                this.buttons= [{
                 text:'关闭',
                 listeners:{
                 	click:function(n) {
                 		this.ownerCt.ownerCt.hide();
                 	}
                 }
                }];
                ShowUserPhoneBill.superclass.initComponent.call(this);
      },
      ToFixed: function (v) {
    	  return parseFloat(v).toFixed(2);
      }
});


QueryHighForm = Ext.extend(Ext.form.FormPanel,{
	region : "center",
	labelAlign:"right",
	width:"100%",
	collapsible:true,
	collapsed:false,
	header:false,
	height:1,
	frame:true,
	layout:'table',
	layoutConfig:{
	tableAttrs: {
		align:'left'
	 },
	columns: 5
 	},
	initComponent: function(){
	var cityNameSelect = new Ext.data.JsonStore({
	    url: "highFee_getCityCode.action?type=1",//第一个comboBox的json数据的URL地址
	    root: "root",
	    fields: ["paramValue", "displayValue"]
	});
	this.items=[{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '归属地市',
							name : 'eparchyCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : areaCodeSelect,
							emptyText:"请选择",
							width:100,
							listeners : {
		 						"select": function(combo){
									combo.ownerCt.ownerCt.getForm().findField("cityCode").reset();
									cityNameSelect.baseParams={'areaCode':combo.getValue()};
									cityNameSelect.load();
		 						}
							}
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '归属区县',
							name : 'cityCode',
							xtype : 'combo',
							editable : false,
							mode : 'remote',
							triggerAction : 'all',
							valueField: "paramValue",
   							displayField: "displayValue",
							store : cityNameSelect,
							emptyText:"请选择",
							width:100
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期',
							name : 'cycleId',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							triggerAction : 'all',
							store : getCyids(),//  [['0','请选择'],['201303','201303'],['201304','201304'],['201305','201305']],
							width:100,
							emptyText:"请选择"
					    }]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期',
							name : 'statDay',
							xtype:"datefield",
							editable : false,
							format:'Y-m-d',
							emptyText:"请选择",
							width:100
					    }]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '客户类型',
							name : 'netTypeCode',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							emptyText:"请选择",
							triggerAction : 'all',
							store : [['','全部'],['10','2G用户'],['33','3G用户']],
							width:100
						 }]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '业务类型',
							name : 'bizType',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							emptyText:"请选择",
							triggerAction : 'all',
							store : [['','全部'],['1','语音'],['2','短信'],['3','GPRS']],
							width:100
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '告警级别',
							name : 'curstatus',
							xtype : 'combo',
							editable : false,
							mode : 'local',
							triggerAction : 'all',
							emptyText:"请选择",
							store : [['','全部'],['1','预警'],['2','警告'],['3','严重'],['4','紧急']],
							width:100
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '用户编码',
							name : 'userId',
							xtype : 'textfield',
							vtype:'number1',
							maxLength:20,//能够输入的内容的最大长度
                            maxLengthText:"输入内容太长了",//超出最大长度的设置信息
							width:100
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '用户名称',
							name : 'userName',
							xtype : 'textfield',
							width:100
						}]},{ 
		    	layout : "form",
		    	xtype:'panel',
		    	colspan:1,
		    	items:[{fieldLabel : '用户号码',
							name : 'msisdn',
							xtype : 'textfield',
							layout:'column',
							width:100
						}]}
		];
	  QueryHighForm.superclass.initComponent.call(this);
	}
	,
	buttonAlign :'center',
	minButtonWidth:60,
	buttons:[{
		text:"查询",
		handler : function(btn){
		    var thisForm = btn.ownerCt.ownerCt.getForm();
		    var eparchyCode  = thisForm.findField('eparchyCode').getValue();
		    var statDay = thisForm.findField('statDay').getValue();	 
		    	statDay = statDay?statDay.format("Ymd"):"";	    
		    var netTypeCode = thisForm.findField('netTypeCode').getValue();
		    var bizType = thisForm.findField('bizType').getValue();
		    var curstatus = thisForm.findField('curstatus').getValue();
		    var userId = thisForm.findField('userId').getValue();
		    var msisdn = thisForm.findField('msisdn').getValue();
		    var userName = thisForm.findField('userName').getValue();
			var cityCode = thisForm.findField('cityCode').getValue();
			var cycleId = thisForm.findField('cycleId').getValue();
			var curstatus = thisForm.findField('curstatus').getValue();
		    var store = btn.ownerCt.ownerCt.thisGrid.getStore();
		    btn.ownerCt.ownerCt.thisGrid.recordStart = 1;
		     var taskSeq = store.baseParams?store.baseParams['myFee.taskSeq']||'':'';
		    store.baseParams = {
		    	'myFee.taskSeq':taskSeq,
				'myFee.userId':userId,
				'myFee.userNbr':msisdn,
				'myFee.eparchyCode':eparchyCode,
				'myFee.cityCode':cityCode,
				'myFee.bizType':bizType,
				'myFee.cycleid':cycleId,
				'myFee.statDay':statDay,
				'myFee.userName':userName,
				'myFee.curstatus':curstatus,
				'myFee.netTypeCode':netTypeCode
		    			//'highFeeUser.areaName':cityCode
			};

            store.load({params:{start:0, limit:200}});
		    
		   //this.ownerCt.ownerCt.ownerCt.hide();//隐藏弹出页面
		}
	}
	, {
		text : '关闭',
		handler : function() {
			this.ownerCt.ownerCt.collapse(true);
			var m = this.ownerCt.ownerCt.ownerCt;
   					var g = m.items.get(1);
   					var a = m.items.get(0);
			g.setHeight(m.getHeight()-m.tbar.dom.clientHeight-1);
   			this.ownerCt.ownerCt.searchBtn.setText("显示查询");
   			this.ownerCt.ownerCt.searchBtn.setIconClass("ico-dot-search-open");
		}
	}]
});
